<HTML><HEAD><TITLE>MessageWrapper.js</TITLE></HEAD><BODY>
<A NAME="_top_"></A><PRE><A HREF="index.html">Index Files</A> </PRE><HR/>
<H1>File MessageWrapper.js</H1>
 Class based on adapter design pattern used to adapt  messages with objects provided by the browser. <P><DL><DT><B>Author:</B></DT><DD>Carlos Eduardo Goncalves</DD></DL></P>
<HR/>
<A HREF=#MessageWrapper>MessageWrapper</A><BR/>
<A HREF=#MessageWrapper.prototype.style>MessageWrapper.prototype.style</A><BR/>
<A HREF=#MessageWrapper.prototype.id>MessageWrapper.prototype.id</A><BR/>
<A HREF=#MessageWrapper.prototype.consumer>MessageWrapper.prototype.consumer</A><BR/>
<A HREF=#MessageWrapper.prototype.refresh>MessageWrapper.prototype.refresh</A><BR/>
<A HREF=#MessageWrapper.prototype.doc>MessageWrapper.prototype.doc</A><BR/>
<A HREF=#MessageWrapper.prototype.address>MessageWrapper.prototype.address</A><BR/>
<A HREF=#MessageWrapper.prototype.silent>MessageWrapper.prototype.silent</A><BR/>
<A HREF=#MessageWrapper.prototype.progressBar>MessageWrapper.prototype.progressBar</A><BR/>
<A HREF=#MessageWrapper.prototype.remoteMethod>MessageWrapper.prototype.remoteMethod</A><BR/>
<A HREF=#MessageWrapper.prototype.parsedMethod>MessageWrapper.prototype.parsedMethod</A><BR/>
<A HREF=#MessageWrapper.prototype.request>MessageWrapper.prototype.request</A><BR/>
<A HREF=#MessageWrapper.prototype.onError>MessageWrapper.prototype.onError</A><BR/>
<A HREF=#MessageWrapper.prototype.onComplete>MessageWrapper.prototype.onComplete</A><BR/>
<A HREF=#MessageWrapper.prototype.wrap>MessageWrapper.prototype.wrap</A><BR/>
<A HREF=#MessageWrapper.prototype.getStream>MessageWrapper.prototype.getStream</A><BR/>
<A HREF=#MessageWrapper.prototype.onChange>MessageWrapper.prototype.onChange</A><BR/>
<A HREF=#MessageWrapper.prototype.parseStatus>MessageWrapper.prototype.parseStatus</A><BR/>
<HR/>
<A NAME=MessageWrapper></A>
<H2>Constructor MessageWrapper</H2><PRE>function MessageWrapper()</PRE> <p>Message wrapper constructor.</p><P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.style></A>
<H2> Attribute MessageWrapper.prototype.style</H2><PRE>MessageWrapper.prototype.style</PRE> <p>Holds a XSL file that will be used to parse the response.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.id></A>
<H2> Attribute MessageWrapper.prototype.id</H2><PRE>MessageWrapper.prototype.id</PRE> <p>Holds message unique id.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.consumer></A>
<H2> Attribute MessageWrapper.prototype.consumer</H2><PRE>MessageWrapper.prototype.consumer</PRE> <p>Holds message consumer element id.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.refresh></A>
<H2> Attribute MessageWrapper.prototype.refresh</H2><PRE>MessageWrapper.prototype.refresh</PRE> <p>Flag that defines if consumer value will be refreshed.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.doc></A>
<H2> Attribute MessageWrapper.prototype.doc</H2><PRE>MessageWrapper.prototype.doc</PRE> <p>Document used to find the message consumer element.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.address></A>
<H2> Attribute MessageWrapper.prototype.address</H2><PRE>MessageWrapper.prototype.address</PRE> <p>URL to request.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.silent></A>
<H2> Attribute MessageWrapper.prototype.silent</H2><PRE>MessageWrapper.prototype.silent</PRE> <p>Flag that defines if the message will display any progress bar.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.progressBar></A>
<H2> Attribute MessageWrapper.prototype.progressBar</H2><PRE>MessageWrapper.prototype.progressBar</PRE> <p>Holds the progress bar used by the message.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.remoteMethod></A>
<H2> Attribute MessageWrapper.prototype.remoteMethod</H2><PRE>MessageWrapper.prototype.remoteMethod</PRE> <p>Holds a <code>RemoteMethod</code> defined as value of the message.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.parsedMethod></A>
<H2> Attribute MessageWrapper.prototype.parsedMethod</H2><PRE>MessageWrapper.prototype.parsedMethod</PRE> <p>Holds a <code>RemoteMethod</code> parsed to XML.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.request></A>
<H2> Attribute MessageWrapper.prototype.request</H2><PRE>MessageWrapper.prototype.request</PRE> <p>Holds the XMLHttpRequest instance used to perform to send the request.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.onError></A>
<H2> Attribute MessageWrapper.prototype.onError</H2><PRE>MessageWrapper.prototype.onError</PRE> <p>Event handler called when a exception occurs.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.onComplete></A>
<H2> Attribute MessageWrapper.prototype.onComplete</H2><PRE>MessageWrapper.prototype.onComplete</PRE> <p>Event handler called after response.</p> <P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.wrap></A>
<H2> Method MessageWrapper.prototype.wrap</H2><PRE>MessageWrapper.prototype.wrap = function(msg)</PRE>  <p>Import all AJAX message data to the wrapper.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>msg</I></TD><TD><code>Message</code> value object to be wrapped.	 </TD></TR></TABLE><DL><DT><B>Throws:</B></DT><DD>Exception that informs if the parameter is not a <code>Message</code> object.</DD></DL></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.getStream></A>
<H2> Method MessageWrapper.prototype.getStream</H2><PRE>MessageWrapper.prototype.getStream = function(format)</PRE>  <p>Create an appropriate stream to read a XML document.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>format</I></TD><TD>XML document format (XMLRPC or SOAP). </TD></TR></TABLE><DL><DT><B>Returns:</B></DT><DD>Valid stream object or <code>null</code>.</DD></DL></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.onChange></A>
<H2> Method MessageWrapper.prototype.onChange</H2><PRE>MessageWrapper.prototype.onChange = function()</PRE>  <p>Internal onreadystatechange listener used by <code>Message</code> instances.</p><P></P><BR/><BR/>
<A NAME=MessageWrapper.prototype.parseStatus></A>
<H2> Method MessageWrapper.prototype.parseStatus</H2><PRE>MessageWrapper.prototype.parseStatus = function(status)</PRE> <p>Return user friendly HTTP status code.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>status</I></TD><TD>Status code. </TD></TR></TABLE><DL><DT><B>Returns:</B></DT><DD><code>String</code> with the request status and its definition.</DD></DL></P><BR/><BR/>
</BODY></HTML>
